<?php
// Init owncloud
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

require_once(OC_App::getAppPath('resumes') . "/lib/resumes.php");
require_once(OC_App::getAppPath('resumes') . "/lib/search.php");

$model = new PResumesModelSearch();

$source = JRequest::getString('source', '');
$term_id = JRequest::getInt('term_id', 0);
$page_num = JRequest::getInt('page_num', 0);
$delaytask_id = JRequest::getInt('delaytask_id', 0);

if ($model->turnPage($term_id, $source, $page_num, $delaytask_id)) {
   OCP\JSON::success();
} else {
   OCP\JSON::error(array('error'=>'网络异常, 请刷新页面重试'));
}
